<template>
	<view class="articleInfo-wrap">
		<view class="articleInfo-title">{{ articleInfo.title }}</view>
		<!-- <rich-text class="articleInfo-rich" :nodes="articleInfo.content"></rich-text> -->
		<!-- <view class="articleInfo-rich"> -->
		<u-mp-html containerStyle="height:94vh" :content="articleInfo.content" :editable="false" />
		<!-- </view> -->


	</view>
</template>

<script>
import uMpHtml from '@/components/u-mp-html/u-mp-html';
export default {
	components: {
		uMpHtml
	},
	data() {
		return {
			id: null,
			articleInfo: {}
		};
	},
	onLoad(option) {
		this.id = option.id ? option.id : null;

		if (this.id) {
			this.articleDetailById();
		}
	},
	onShow() {
		// this.articleDetailById();
	},
	methods: {
		//查询文章详情
		articleDetailById() {
			this.$api
				.articleDetailById({
					params: {
						id: this.id
					}
				})
				.then(res => {
					if (res.code == 200) {
						this.articleInfo = res.result;
					}
				});
		}
	}
};
</script>

<style lang="less">
@import './articleInfo.less';
</style>
